package com.qdlc.p2p.dal.dto;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.qdlc.p2p.common.constant.Global;
import com.qdlc.p2p.common.util.DateUtil;

/**
 * 新的活动方案发放记录
 *
 * @author liya
 * @version 1.1.0.0
 */
@Entity
@Table(name = Global.DB_PREFIX + "new_activity_award_log")
public class NewActivityAwardLog {

    /** 主键 */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;

    /** 奖励接收人 */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id")
    private User user;

    /** 邀请奖励时 - 被邀请人 */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "be_invited_user_id")
    private User beInvitedUser;

    /** 活动环节：register,invite,tender,first_tender,sign */
    private String tache;

    /** 规则ID */
    private long ruleId;

    /** 1:红包 2:体验券 3:加息券 4:抽奖 5:电影票 */
    private int ruleType;

    /** 获得次数 */
    private int count;

    /** 金额大小，加息额度大小 */
    private double amount;

    private Date addTime;

    /**
     * 构造函数
     */
    public NewActivityAwardLog() {
    }

    public NewActivityAwardLog(User user, String tache, double amount, int ruleType) {
        this.user = user;
        this.tache = tache;
        this.amount = amount;
        this.ruleType = ruleType;
        this.addTime = DateUtil.getNow();
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public User getBeInvitedUser() {
        return beInvitedUser;
    }

    public void setBeInvitedUser(User beInvitedUser) {
        this.beInvitedUser = beInvitedUser;
    }

    public String getTache() {
        return tache;
    }

    public void setTache(String tache) {
        this.tache = tache;
    }

    public long getRuleId() {
        return ruleId;
    }

    public void setRuleId(long ruleId) {
        this.ruleId = ruleId;
    }

    public int getRuleType() {
        return ruleType;
    }

    public void setRuleType(int ruleType) {
        this.ruleType = ruleType;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

}
